package service.factory;

import service.*;
import service.impl.*;


//所有manager的工厂方法都在这里
public class ManagerFactory {
	
	private static AdminManager adminManager;
	private static MerchantManager merchantManager;
	private static CategoriesManager categoriesManager;
	private static FoodManager foodManager;
	private static ClientUsersDaoManager clientUserDaoManager;
	
	public static AdminManager getUserManagerInstance(){
		if (adminManager==null) {
			adminManager = new AdminManagerImpl();
		}
		return adminManager;
	}
	
	public static MerchantManager getMerchantManagerInstance(){
		if (merchantManager==null) {
			merchantManager = new MerchantManagerImpl();
		}
		return merchantManager;
	}
	
	public static CategoriesManager getCategoriesManagerInstance(){
		if (categoriesManager==null) {
			categoriesManager = new CategoriesManagerImpl();
		}
		return categoriesManager;
	}
	
	public static FoodManager getFoodManagerrInstance(){
		if (foodManager==null) {
			foodManager = new FoodManagerImpl();
		}
		return foodManager;
	}
	
	public static ClientUsersDaoManager getClientUserDaoManager(){
		if(clientUserDaoManager == null)
			clientUserDaoManager = new ClientUsersDaoManageImpl();
		return clientUserDaoManager;
	}
}
